import { axios } from '@/utils/request'

export const getDeptTree = (hospitalId) => {
  return axios({
    url: 'dept/tree/hospital/' + hospitalId,
    method: 'get'
  })
}

export const getDeptById = (id) => {
  return axios({
    url: 'dept/' + id,
    method: 'get'
  })
}

export const saveDept = (data) => {
  return axios({
    url: 'dept',
    method: 'post',
    data
  })
}

export const updateDeptById = (id, data) => {
  return axios({
    url: 'dept/' + id,
    method: 'put',
    data
  })
}

export const removeDeptById = (id) => {
  return axios({
    url: 'dept/' + id,
    method: 'delete'
  })
}
